<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
    <title>修改货品单</title>
<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/admin_style.css" />
<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/table.css" />
<script type="text/javascript">
var APP = "__ROOT__";	
</script>
<script src="__STATIC__/js/jquery-1.7.2.min.js"></script>
	<script src="__PUBLIC__/js/addGoodsList.js"></script>
    <script type="text/javascript" src="__STATIC__/uploadify/jquery.uploadify.min.js"></script>
    <link href="__STATIC__/uploadify/uploadify.css" type="text/css" rel="stylesheet"></link>
       <!-- 配置文件 -->
    <script type="text/javascript" src="__STATIC__/ueditor/ueditor.config.js"></script>
    <!-- 编辑器源码文件 -->
    <script type="text/javascript" src="__STATIC__/ueditor/ueditor.all.min.js"></script>
    <style type="text/css"> 
   	.tab1{
   		display:none;
   	}
    .hiddenli{
    	position: relative;
    	top:-50px;
    	left:0px;
    	display: none;
    }
    .hiddenli span{
		width: 35px;
		padding: 2px;
		height: 40px;
		line-height: 40px;
		text-align: center;
		border: 1px solid #DDD;
		border-radius: 5px;
		float: left;
		background: #6595F5;
		cursor: pointer;
    }
   .hiddenli  .imgshow{
		width: 400px;
		height: 400px;
		background: none repeat scroll 0% 0% #FFF;
		border-radius: 5px;
		position: absolute;
		top: 50px;
		left: -1px;
		z-index: 1000;
		display: none;
    }
    .hiddenli  .imgshow .close{
    	height: 40px;
    	width: 40px;
    	background: #fff;
    	text-align: center;
    }
    .showGoosIMg li{
        list-style: none;
        float: left;
        width: 200px;
        height:200px;
        padding: 5px;
    }
    li{
        padding: 0px 10px;
        float: left;
        list-style: none;
    }
    li input{
        padding: 3px: 
    }
    .specValue{
        width: 600px;

    }
    .showGoosIMg li img{
        width: 200px;
        height: 200px;
        overflow: hidden;
    }
    .btn{
        display: inline-block;
        padding: 5px;
        background: #518CF1;
        color: #fff;
        cursor: pointer;
        text-align: center;
        border-radius: 5px;
        border:1px solid #ddd;
    }
    </style>
    <script type="text/javascript">
    $(function(){
        $('select[name=pid]').change(function(){
           tid = $(':selected').attr('tid');
            $.ajax({
               type: "POST",
               url: "{|U:'getGoodsAttr'}",
               data: {tid:tid},
               dataType:'json',
               success: function(msg){
                    var attr = '';
                    var spec = '';
                    $.each(msg,function(k,v){
                        //==0属性 ==1 规格
                        if(v.attr_class == 0){
                            attr += "<li style='width:200px; heigh:50px;line-heigt:50px;inline-block;padding:5px 5px;'><input type='hidden' name='type_tid' value='"+v.type_tid+"' />"+v.attr_name+": <select name='attr[]' class='w200'><option value=''>选择属性</option>";
                                $.each(v.attrValue,function(kk,vv){
                                     attr += " <option value='"+v.aid+"|"+vv+"'>"+vv+"</option>";
                                });                       
                            attr += " </select></li>";
                        }else{
                           spec += "<li>"+v.attr_name+":<br/> ";
                                $.each(v.attrValue,function(kk,vv){
                                    spec += " <span class='attrtitle' style='width:180px;display:inline-block; heigh:50px;line-heigt:50px;'><input type='checkbox' value='"+v.aid+"|"+vv+"' name='spec[]'  />"+vv+"</span><span style='width:100px; heigh:50px;line-heigt:50px;inline-block;'>附加价格:<input type='text' name='specPric[]' class='w100'  /></span><br/>";
                                }); 
                                spec += " </li>";
                        }
                        
                    })
                    $('.attrValue').html(attr);
                    $('.specValue').html(spec);
               }
            });
        })
        //附加价格  规格
        $('.specValue input').live('click',function(event) {
                  s=$(this).index();
            if($('.specValue input').eq(s).attr('checked') == true){    
                   $('.specValue span').eq(s).html('<input type="text" name="goods_attr_value[]" class="w100"/>');
            }else if($(this).attr('checked') == false){
               
            }
        })
        

    })
    </script>
</head>
<body>
<body class="right_body">
	<div class="body">
		<div class="top_subnav">CMS内容管理平台 ＞ 修改货品单</div>


		<div style="clear:both"></div>
		<div class="use_meth">
			<div class="title">
				<div class="title_info light">
					修改货品单
				</div>
			</div>
<div class="wrap">
<div class="hd-title-header">修改货品单</div>
    <form action="" method="post" class="form-inline hd-form" enctype="multipart/form-data">
        <table class="hd-table hd-table-list table">
           	
         
            <tr>
                <th class="w100">库存</th>
                <td  class="w100">
                    <input type="text" name="goods_list_stock[]" class="w200" value="{$goodstData['goods_list_stock']}"/> 
                </td>
                <td></td>
            </tr>
            <tr>
                <th class="w100">货号</th>
                <td  class="w100">
                    <input type="text" name="goods_list_nums[]" class="w200" value="{$goodstData['goods_list_nums']}"/> 
                </td>
                <td>不填写则自动生成</td>
            </tr>
           <tr>
                <th class="w100">货品规格</th>
                <td>
                    <div class="specValue" width="650">
<foreach from="$typeAttrData" key="$k" value="$v">  
       
    <li>{$v.attr_name}<br/> 
     <select name="attr['goods_attr_id{$k}'][]" class="w200">
         <foreach from="$v.goods_attr_value" key="$key" value="$val">
             <span class='attrtitle' style='width:180px;display:inline-block; heigh:50px;line-heigt:50px;'>
             <option value="<?php echo $typeAttrData[$k]['goods_attr_id'][$key] ?>" 
             	
             	<foreach from="$goodstData['attr']" key="$ke" value="$va">
             		<if value="$va == $val"> selected = "selected"</if>
             	</foreach>
             	
             	
             	
             	>{$val}</option>
            </span>
             </span><br/>
        </foreach>   
     </select> 
     </li>
 </foreach>       
                 </div>
                </td>
                <td></td>
            </tr>
          
            
        </table>
        <div class="position-bottom">
        	<input type="hidden" name='goods_gid' value="<?php echo $_GET['gid'] ?>"/>
            <input type="submit" class="hd-btn hd-btn-success" value="修改"/>
        </div>
    </form>
</div>
		</div>
	
	</div>




</body>
</html>
